<template>
	<view>
		<u-cell-group>
				<u-cell  title="客户">
					<view  slot="value">{{list.customerName}}</view>
				</u-cell>
				<u-cell  title="跟进人">
					<view  slot="value">{{list.followUserName}}</view>
				</u-cell>
				<u-cell  title="跟进时间">
					<view  slot="value">{{list.followTime}}</view>
				</u-cell>
				<u-cell  title="跟进方式">
					<view  slot="value">{{list.followMethod}}</view>
				</u-cell>
				<u-cell  title="跟进内容">
					<view  slot="value">{{list.followContent}}</view>
				</u-cell>
				<u-cell  title="下次跟进时间">
					<view  slot="value">{{list.nextFollowTime}}</view>
				</u-cell>
				<u-cell  title="地址">
					<view  slot="value">{{list.position}}</view>
				</u-cell>
				<u-cell  title="图片">
					<view  slot="value">
					<image  style="width: 25vh;height:25vh;" :src="'http://101.132.141.5:8081'+list.enclosure"></image>
					</view>
				</u-cell>
		</u-cell-group>
	</view>
</template>

<script>
	import {getFollow} from '@/api/follow.js'
	import { getDicts } from '@/api/dictionary/index.js';
	export default {
		data(){
			return{
				list:[],
				followMethodOptions:[]
			}
		},
		onLoad(e) {
			this.getFollowMethod()
			this.getFollowInfo(e.id)
		},
		methods:{
			getFollowMethod() {
			    getDicts('biz_followmethod').then(res => {
			        console.log(res);
			        this.followMethodOptions=res.data
			    })
			},
			getFollowInfo(val){
				getFollow(val).then(response=>{
					console.log(response);
					response.data.followMethod = this.getValue(this.followMethodOptions,response.data.followMethod)
					this.list=response.data
				})
			},
			getValue(arr, item) {
			    console.log(arr, item);
			    for (var i = 0; i < arr.length; i++) {
			        if (item == arr[i].dictValue) {
			            console.log(arr[i].dictLabel);
			            return arr[i].dictLabel
			        }
			    }
			},
		}
	}
</script>

<style  lang="scss" scoped>
	pages{
		background-color: #fff;
	}
</style>